package com.test.concurrent;

import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;

/**
 * @author: zhangzeli
 * @date 14:38 2018/4/26
 * <P></P>
 */
public class Plus implements Runnable {
    public static BlockingQueue<Msg> bq = new LinkedBlockingQueue<>();

    @Override
    public void run() {
        while (true){
            try {
                Msg msg = bq.take();
                msg.i = msg.i+msg.j;
                Multiply.bq.add(msg);
            }catch (InterruptedException e){}
        }
    }
}
